package com.yanqu.road.server.cmd.union;

import com.yanqu.road.message.YanQuMessage;
import com.yanqu.road.pb.union.cross.CrossUnionProto;
import com.yanqu.road.server.command.Cmd;
import com.yanqu.road.server.command.Command;
import com.yanqu.road.server.manger.activity.unionwar.UnionPhaseWarMgr;
import com.yanqu.road.server.manger.activity.unionwar.UnionWar;
import com.yanqu.road.server.protocol.Protocol;
import io.netty.channel.ChannelHandlerContext;

@Cmd(code = Protocol.S_UNION_ACTIVITY_LOCK_RANK_FROM_CROSS, desc = "活动锁定排行")
public class UnionActivityLockRankCmdFromCross implements Command {


    @Override
    public void execute(ChannelHandlerContext ctx, YanQuMessage packet) throws Exception {

        CrossUnionProto.CrossUnionActivityLockRankResp resp = CrossUnionProto.CrossUnionActivityLockRankResp.parseFrom(packet.getBytes());
        //目前只有群英争霸
        int activityId = resp.getActivityId();
        UnionWar unionWar = UnionPhaseWarMgr.getUnionWar(activityId);
        if(unionWar != null){
            unionWar.initCrossUnionWarUnionLockListFromCross(resp.getRankList(), 0);
        }

    }
}
